package com.iflytek.vo;

import java.util.List;

public class PageVO<T> {

    /**
     * 当前页码
     */
    protected Integer pageNum;

    /**
     * 每页条数
     */
    protected Integer size;

    /**
     * 总条数
     */
    protected Long total;
    protected List<T> records;
    /**
     * 总页数
     */
    private Integer totalPage;
    /**
     * 搜索内容
     */
    private String searchContent;
    /**
     * 搜索方式
     */
    private String searchType;

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    public Integer getTotalPage() {
        return Integer.valueOf(String.valueOf((total - 1) / size + 1));
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public String getSearchContent() {
        return searchContent;
    }

    public void setSearchContent(String searchContent) {
        this.searchContent = searchContent;
    }

    public String getSearchType() {
        return searchType;
    }

    public void setSearchType(String searchType) {
        this.searchType = searchType;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("PageDto{");
        sb.append("pageNum=").append(pageNum);
        sb.append(", size=").append(size);
        sb.append(", total=").append(total);
        sb.append(", list=").append(records);
        sb.append(", totalPage=").append(totalPage);
        sb.append(", searchContent=").append(searchContent);
        sb.append(", searchType=").append(searchType);
        sb.append('}');
        return sb.toString();
    }
}
